package com.onpositive.mediawiki.crawler;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;

import com.onpositive.wiki3.db.LocationProperties;

public class WikiLauncher {

	public static void main(String[] args) {
		
		String loc = LocationProperties.getProperty(LocationProperties.LOCATION_RAW_VALUES);
		File file = new File(loc);
		if(file.exists())
			file.delete();
		
		file.getParentFile().mkdirs();
		
		PrintStream ps=null;
		try {
			ps = new PrintStream(file);
			StreamExtractor se = new StreamExtractor(ps);
			se.extractAll(null,true,true);
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		finally{
			if(ps!=null){
				ps.close();
			}
		}
	}

}
